<!-- js call TinyMCE -->
<script type="text/javascript">
	edittext('description');
	edittext('content');
</script>

<!-- js validate form  -->
<script type="text/javascript">
	$(document).ready(function() {
		$("#add").validate();		
	});	
	$.metadata.setType("attr", "validate");
</script>


            <div class="header2">
                <p class="pHead"><?php echo $title;?></p>
                <img src="images/icon/back.png" class="iconBack" alt="icon" />
                <span class="back"><a href="#">Quay lại trang trước</a></span>
            </div>
            
            <form method="POST" action="<?php echo base_url();?>back_end/news/edit/<?php echo $admin_news['id'] ?>" name="add" id="add" enctype="multipart/form-data">
            <div class="contentMain">
            	<div class="contentSearch">            	
            	<table class="tableSearch">
                	<tr>
                    	<td class="tdSearch">Tên danh mục tin tức:</td>
                    	<td class="tdSearch2">
                    		<input type="text" class="required inputText" id="name" name="title" value="<?php echo $admin_news['title']; ?>">
                    	</td>
                    </tr>
                    <tr>
                    	<td class="tdSearch">Danh mục cha:</td>
                    	<td class="tdSearch2">
                    		<select name="parent_id" class="selectText">
                            	<option value="0">------------------------- Chọn danh mục tin tức -------------------------</option>
                            	<?php foreach ($list_categoryNews as $key=>$value) {?>
									<option value="<?php echo $key; ?>" <?php if($admin_news['category_news_id'] == $key) {echo 'selected=selected';} ?> >
										<?php echo $value; ?>
									</option>		                            	
                           		<?php }?>
                            </select>
                    	</td>
                    </tr>
                	<tr>
                    	<td class="tdSearch" style="vertical-align: top;">Mô tả:</td>
                    	<td class="tdSearch2">
                    		<textarea  id="description" name="description" class="textArea1" style="width:800px;">
                    			<?php echo $admin_news['description']; ?>
                    		</textarea>
                    	</td>
                    </tr>
                    <tr>
                    	<td class="tdSearch" style="vertical-align: top;">Nội dung:</td>
                    	<td class="tdSearch2">
                    		<textarea id="content" name="content" class="textArea1" style="width:800px; height: 800px;"><?php echo $admin_news['content']; ?></textarea>
                    	</td>
                    </tr>
                    <tr>
                    	<td class="tdSearch" style="vertical-align: top;">Ảnh đại diện:</td>
                    	<td class="tdSearch2">
                    		<img class="img_news"  alt="<?php echo $admin_news['image']; ?>" src="<?php echo base_url() ?>images/img_news/<?php echo $admin_news['image']; ?>"/>
                    	</td>
                    </tr>
                    <tr>
                    	<td class="tdSearch" style="vertical-align: top;">Thay đổi ảnh đại diện:</td>
                    	<td class="tdSearch2">
                    		<input type="file" id="images" value="" name="image">
                    	</td>
                    </tr>
                    <tr>
                    	<td class="tdSearch">Trạng thái:</td>
                    	<td>
                    		<input type="checkbox" value='1' name="status" class="inputCheck" <?php if ($admin_news['status'] == 1) { echo 'checked=checked';} ?> />
                    	</td>
                    </tr>
                	<tr>
                    	<td class="tdSearch">&nbsp;</td>
                    	<td class="tdSearch2">                        	
                            <div class="searchbutton">
                                    <input type="submit" class="buttonSM" value="Add" name="editForm" />
                            </div><!-- end searchbutton -->                      	
                            <div class="searchbutton searchReset" >
                                    <input type="reset" class="buttonSM"  value="Reset" name="reset" />
                            </div><!-- end searchbutton -->
                        </td>
                    </tr>
                </table>
            </div><!-- end contentSearch -->
            </div><!-- end contentMain -->
            </form>